package com.wkedu.recommend.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wkedu.recommend.dao.entity.MemberUser;
import com.wkedu.recommend.dao.mapper.MemberUserMapper;
import com.wkedu.recommend.service.MemberUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 港港
 * @version 1.0
 * @date 2021/8/12 下午7:03
 */
@Service
public class MemberUserServiceImpl implements MemberUserService {

    @Resource
    private MemberUserMapper mapper;

    @Override
    public int selectIdByName(String name) {
        QueryWrapper<MemberUser> objectQueryWrapper = new QueryWrapper<>();
        objectQueryWrapper.eq("USER_NAME",name);
        MemberUser memberUser = mapper.selectOne(objectQueryWrapper);
        return memberUser.getUserId();
    }
}
